import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/HomePage/index.vue'

const routes = [
  {
    path: '/', redirect: '/login',
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children: [
      {
        path: '/home', redirect: '/home/sysctrl/person',
      },
      {
        path: 'sysctrl',
        name: 'SysCtrl',
        meta:{
          icon:'setting',
          title:"系统管理"
        },
        component: () => import('../views/HomePage/SysCtrl.vue'),
        children: [
          {
            path: 'person',
            name: 'person',
            meta:{
              title:"人员管理"
            },
            component: () => import('../components/HelloWorld.vue'),
          }, {
            path: 'role',
            name: 'role',
            meta:{
              title:"角色管理"
            },
            component: () => import('../components/HelloWorld.vue'),
          }, {
            path: 'auth',
            name: 'auth',
            meta:{
              title:"权限管理"
            },
            component: () => import('../components/HelloWorld.vue'),
          }, {
            path: 'menu',
            name: 'menu',
            meta:{
              title:"菜单管理"
            },
            component: () => import('../components/HelloWorld.vue'),
          }
        ]
      },
      {
        path: 'dataquery',
        name: 'DataQuery',
        meta:{
          icon:'s-data',
          title:'数据统计'
        },
        component: () => import('../views/HomePage/DataQuery.vue'),
        children: [
          {
            path: 'datasum',
            name: 'datasum',
            meta:{
              title:'数据统计(地域)'
            },
            component: () => import('../components/HelloWorld.vue'),
          },
          {
            path: 'dataprv',
            name: 'dataprv',
            meta:{
              title:'省销售统计(地域)'
            },
            component: () => import('../components/HelloWorld.vue'),
          },
          {
            path: 'activeprv',
            name: 'activeprv',
            meta:{
              title:'省活跃度统计(地域)'
            },
            component: () => import('../components/HelloWorld.vue'),
          },
        ]
      },
      {
        path: 'cardctrl',
        name: 'CardCtrl',
        meta:{
          icon:'folder',
          title:'卡号管理'
        },
        component: () => import('../views/HomePage/CardCtrl.vue'),
        children: [
          {
            path: 'cardclass',
            name: 'CardClass',
            meta:{
              title:'卡号批次设置'
            },
            component: () => import('../components/HelloWorld.vue'),
          }
        ]
      }, {
        path: 'viphub',
        name: 'VipHub',
        meta:{
          icon:'user',
          title:'大客户专员专区'
        },
        component: () => import('../views/HomePage/VipHub.vue'),
        children: [
          {
            path: 'kehu',
            name: 'kehu',
            meta:{
              title:'大客户专员列表'
            },
            component: () => import('../components/HelloWorld.vue'),
          }, {
            path: 'viporder',
            name: 'Viporder',
            meta:{
              title:'订单列表'
            },
            component: () => import('../components/HelloWorld.vue'),
          }, {
            path: 'setting',
            name: 'setting',
            meta:{
              title:'设置'
            },
            component: () => import('../components/HelloWorld.vue'),
          }
        ]
      }, {
        path: 'moneyctrl',
        name: 'MoneyCtrl',
        meta:{
          icon:'notebook-1',
          title:'财务管理'
        },
        component: () => import('../views/HomePage/MoneyCtrl.vue'),
        children: [
          {
            path: 'pocket',
            name: 'pocket',
            meta:{
              title:'钱包列表'
            },
            component: () => import('../components/HelloWorld.vue'),
          }, {
            path: 'order',
            name: 'order',
            meta:{
              title:'订单列表'
            },
            component: () => import('../components/HelloWorld.vue'),
          }, {
            path: 'tixian',
            name: 'tixian',
            meta:{
              title:'提现列表'
            },
            component: () => import('../components/HelloWorld.vue'),
          }, {
            path: 'shenhe',
            name: 'shenhe',
            meta:{
              title:'审核订单列表'
            },
            component: () => import('../components/HelloWorld.vue'),
          },

        ]
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
